<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/constrant.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link href="${ctxStatic }/wx/mui/css/mui.min.css" rel="stylesheet" />
<link rel="stylesheet" href="${ctxStatic }/wx/css/pensonal.css" />
<script src="${ctxStatic }/wx/mui/js/mui.min.js"></script>
<script src="${ctxStatic }/zepto/zepto.js"></script>
<style>
     	html{
     		width: 100%;
     		background: #f5f5f5;
     	}
     	.mui-input-row{
     		background: #fff;
     	}
      .mui-input-group:after{
      	background: none;
      }
     </style>
	<title>修改密码</title>
</head>
<body>
		<div id="modify password" class="mui-page">
			<div class="mui-navbar-inner mui-bar mui-bar-nav">
				<button type="button" class="mui-left mui-action-back mui-btn  mui-btn-link mui-btn-nav mui-pull-left" style="color: #fff;">
					<span class="mui-icon mui-icon-left-nav"  style="color: #fff;"></span>设置
				</button>
				<h1 class="mui-center mui-title" style="color: #fff;">修改密码</h1>
			</div>
			<div class="m_password">
				  <form class="mui-input-group" id="subForm" >
				  	<input type="hidden" name="userid" value="${sessionScope.front_user.id}"/>
				      <div class="mui-input-row">
				          <label>原始密码</label>
				          <input type="password" class="mui-input-clear" placeholder="请输入原始密码" name="oldPassword">
				      </div>
				      <div class="mui-input-row">
				          <label>密码</label>
				          <input type="password" class="mui-input-clear" placeholder="请输入新密码" name="newPassword">
				      </div>
				      <div class="mui-input-row">
				          <label>确认密码</label>
				          <input type="password" class="mui-input-clear" placeholder="请确认新密码" name="repeatPassword">
				      </div>
				      <div class="m_password_btn">
				      	  <input type="button" value="确认修改" id="sub"/>
				      </div>
				  </form>
			</div>
		</div>
		<script type="text/javascript">
			mui.init();
			Zepto(function(){
				$('#sub').on('tap', function() {
				mui.post('${ctxWx}/my/modifyPwd',$("#subForm").serialize(),function(d){
							if(d.code=='200'){
								mui.alert('修改密码成功',function(){
									window.location.href = "${ctxWx}/my/myInfoPage";
								})
							}else{
								mui.alert(d.message)
							}
				}, 'json');
				});
			});
		</script>
	</body>
</html>